﻿function FireworkMaker() {
    $("body").prepend(
        '<div id="fireworks-template">'
         + '<div id="fw" class="firework"></div>'
         + '<div id="fp" class="fireworkParticle"><img src="/Images/Fireworks/particles.gif" alt="" /></div>'
         + '</div>'
         + '<div id="fireContainer"></div>'
    );
};

FireworkMaker.prototype = (function () {
    var standardCircle = function () {
        createFirework(11, 30, 3, 4, null, null, null, null, false, true);
    };

    var concentricCircles = function () {
        createFirework(25, 187, 5, 1, null, null, null, null, false, true);
    };

    var cornered = function () {
        createFirework(66, 139, 4, 5, 1, 1, 97, 96, true, true);
    };

    var semiCircle = function () {
        createFirework(38, 128, 2, null, 49, 2, 50, 100, false, true); return false
    };

    return {
        constructor: FireworkMaker,

        makeFireworks: function () {
            semiCircle();
            for (var i = 0; i < 6; i++) {
                setTimeout(function () {
                    standardCircle();
                    standardCircle();
                    semiCircle();
                    semiCircle();
                    cornered();
                }, 1500 * i);
                setTimeout(function () {
                    standardCircle();
                    standardCircle();
                }, 2000 * i);
            }
        }
    };
})();